<template>
  <div
    id="app"
    :style="$route.path.includes('screen') ? 'overflow-y: hidden;' : 'overflow-y: scroll;'"
  >
    <router-view />
    <el-backtop target="#app" :visibility-height="100"></el-backtop>
  </div>
</template>
<script>
export default {
  name: 'app',
  mounted() {
    if (this.isMobile()) {
      window.open('https://results.hfzlyd.com/mobile/overview', '_self')
    }
  },
  watch: {},
  methods: {
    isMobile() {
      let flag = navigator.userAgent.match(
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      )
      return flag
    }
  }
}
</script>
<style lang="scss">
@import './assets/scss/ESafeboxStyle';
@import './assets/scss/layout';

#app {
  width: 100%;
  height: 100vh;
  /* 这里给app一个滚动效果 */
  // overflow-y: scroll;
  overflow-y: hidden;
}
</style>
